<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/1/29 0029
  Time: 18:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <base href="http://${pageContext.request.serverName}:${pageContext.request.serverPort}${pageContext.request.contextPath}/">
    <script type="application/javascript" src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body>
<a href="test/ssm.html">测试SSM</a>
<button id="btn1">点击测试ajax</button>

<script>

    $(function () {
        $("#btn1").click(function () {

            var array = [5, 8, 12]
            var requestBody = JSON.stringify(array);

            $.ajax({
                "url": "send/array/three.html",
                "type": "post",
                "data": requestBody,
                "contentType": "application/json;charset=UTF-8",
                "dataType":"text",
                "success":function (response) {
                    alert(response)
                },
                "error":function (response) {
                    alert(response)
                }


        })
        })
    })

</script>

</body>
</html>
